﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.HomeServer.Controls;
using RouterControl.Whs.Wizards;
using RouterControl.IO.Services;

namespace RouterControl.WhsAddIn.Wizards
{
    public partial class EditPortForwardingWelcome : WizardPageClientBannerTop
    {

        private EditPortForwarding ParentWizard2
        {
            get { return (EditPortForwarding)this.ParentWizard; }
        }

        public EditPortForwardingWelcome()
        {
            InitializeComponent();
        }

        private void EditPortForwardingWelcome_OkButtonClick(object sender, EventArgs e)
        {
            SetCurrentPage<EditPortForwardingPortAndProtocol>();
        }

        public override void StartRealWork()
        {
            base.StartRealWork();

            // determine if a new port forwarding is created
            this.ParentWizard2.OriginalForwarding = this.ParentWizard2.Forwarding;

            if (this.ParentWizard2.Forwarding == null)
            {
                this.ParentWizard2.NewForwardingMode = true;
                this.ParentWizard2.Forwarding = new CommonInternetGateway.PortForwarding();
            }
            else
            {
                this.ParentWizard2.NewForwardingMode = false;
            }
        }
    }
}
